package ute.mvc.controller.portal.student;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import ute.mvc.model.Subject;
import ute.mvc.service.SubjectService;

@Controller
@RequestMapping(value="/student/{studentId}/{openCourseId}/{subjectId}")
public class StudentSubjectController {

	@Autowired
	SubjectService subjectService;

	@RequestMapping(value = "/", method = RequestMethod.GET)
	public String getSubjectHome(@PathVariable String openCourseId,
			@PathVariable String subjectId, Model model) {

		
		Subject subject = subjectService.getSubjectById(subjectId);

		model.addAttribute("subject", subject);
		return "student_subject_info";
	}
}
